package kr.hkit.powerjava.chapter21;

public class IndexOutOfBoundsExceptionEx {
	public static void main(String[] args) {
		int[] arr = {1,2,3,4,5};
		int i = 0;
		
		try {
			for(i=0; i<= arr.length; i++){
				System.out.println(arr[i] + " ");
			}
		} catch (/*ArrayIndexOutOfBounds*/Exception e) {
			System.out.println("인덱스 " + i + "사용불가" + e.getLocalizedMessage());
			e.printStackTrace();
			
		}
		
	}
}
